package com.intermancer.util;

import java.io.InputStream;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.core.io.Resource;

public class InputStreamResourceAdapter implements FactoryBean {
	
	private Resource resource;

	@Override
	public Object getObject() throws Exception {
		return resource.getInputStream();
	}

	@SuppressWarnings("unchecked")
	@Override
	public Class getObjectType() {
		return InputStream.class;
	}

	@Override
	public boolean isSingleton() {
		return false;
	}

	public void setResource(Resource resource) {
		this.resource = resource;
	}

}
